Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add ChainRules differentiation rules for expv #51

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sethaxen
Copy link

Following #40, this PR implements forward- and reverse-mode rules for expv, adding compatibility with Zygote and perhaps making ForwardDiff2's differentiation of these rules faster.

This is still marked as a WIP until I figure out sensitivities of the matrix A.

∂b = Thunk() do
# using similar is necessary to ensure type-stability
b̄ = similar(b)
_copyto!(b̄, expv(t', A', Δw; kwargs...))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjoint is currently not part of the required interface for generic A. How should we handle this?

  • Make it a required part of the interface
  • Make it an optional requirement for A (i.,e. "if you want to work with Zygote, you also need to define adjoint")
  • restrict this rrule to A::AbstractMatrix (this may be necessary anyways, as for non-matrix A, its differential type is unknown.).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"if you want to work with Zygote, you also need to define adjoint"

I think that's entirely reasonable.

@sethaxen sethaxen mentioned this pull request Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants